/*
 * NewJFrame.java
 *
 * Created on 22 / maig / 2008, 10:34
 */

package vistes;

import java.awt.event.ActionListener;

/**
 *
 * @author  lipi
 */
public class VistaPrincipal extends javax.swing.JFrame {
      
    VistaGProgrames vGProgs;
    
    /** Creates new form NewJFrame */
    public VistaPrincipal(VistaGProgrames nVistes) 
    {
        /**Totes les pestanyes que hi haura*/
        vGProgs = nVistes;
        
        try {
            initComponents();
        } catch (Exception ex) {
            System.out.println("Err al carregar bbdd");
        }
    }
    
    public void setActions(ActionListener actions[])
    {
        saveAll.addActionListener(actions[0]);
        importaProgs.addActionListener(actions[1]);
        esborraRepoProgs.addActionListener(actions[2]);
        exportaProgs.addActionListener(actions[3]);
    }
        
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        saveAll = new javax.swing.JMenuItem();
        clearAll = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        importaProgs = new javax.swing.JMenuItem();
        exportaProgs = new javax.swing.JMenuItem();
        esborraRepoProgs = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenu5 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenuItem6 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jMenu1.setText("Fitxer");

        saveAll.setText("Guardar tot");
        jMenu1.add(saveAll);

        clearAll.setText("Esborrar la BBDD");
        jMenu1.add(clearAll);

        jMenu3.setText("Programes");

        importaProgs.setText("Importar Programes");
        jMenu3.add(importaProgs);

        exportaProgs.setText("Exportar Programes");
        jMenu3.add(exportaProgs);

        esborraRepoProgs.setText("Esborrar Repositori Programes");
        jMenu3.add(esborraRepoProgs);

        jMenu1.add(jMenu3);

        jMenu4.setText("Franges");
        jMenu1.add(jMenu4);

        jMenu5.setText("Planificació");
        jMenu1.add(jMenu5);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Ajuda");

        jMenuItem7.setText("Manual d'usuari");
        jMenu2.add(jMenuItem7);

        jMenuItem8.setText("Ampliacions futures");
        jMenu2.add(jMenuItem8);

        jMenuItem6.setText("Sobre el programa");
        jMenu2.add(jMenuItem6);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 972, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 643, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.add("Programes",vGProgs);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem clearAll;
    private javax.swing.JMenuItem esborraRepoProgs;
    private javax.swing.JMenuItem exportaProgs;
    private javax.swing.JMenuItem importaProgs;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JMenuItem saveAll;
    // End of variables declaration//GEN-END:variables
    
}
